package me.haoliang.service.impl;

import me.haoliang.service.UserService;
import me.haoliang.vo.UserVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by pulangke on 2017/5/22.
 */
@Service
public class UserServiceImpl implements UserService {

    private static Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);

    @Override
    public List<UserVo> getUsers() {
        List<UserVo> userVos = new ArrayList<>();
        UserVo userVo1 = new UserVo();
        userVo1.setId(1);
        userVo1.setName("luhui");

        userVos.add(userVo1);

        UserVo userVo2 = new UserVo();
        userVo2.setId(2);
        userVo2.setName("rourou");

        userVos.add(userVo2);

        return userVos;
    }

    @Override
    public UserVo getUser(Integer id) {
        UserVo userVo = new UserVo();
        userVo.setId(id);
        userVo.setName("rourou");
        return userVo;
    }

    @Override
    public void updateUser(UserVo userVo) {
        logger.info("updateUser");
    }
}
